package api

import (
	"batbat-backend/app/service"
	"batbat-backend/library/response"
	"github.com/gogf/gf/net/ghttp"
)

var Rsa = rsaApi{}

type rsaApi struct{}

// Create
// @summary 创建公私钥对
// @tags 	加密
// @produce	json
// @success	200 {object} response.JsonResponse{data=model.RsaApiCreateResp}
// @router /rsa [POST]
func (ra *rsaApi) Create(r *ghttp.Request) {
	resp, err := service.Rsa.Create(r.Context())
	if err != nil {
		response.Error(r, err)
	}
	response.Success(r, resp)
}
